﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ECommerce.DAO.Cache.Controles
{
    public static class WebControl
    {
        //Select Methods
        public static ECommerce.Model.Controles.WebControl GetWebControlById(int ident)
        {
            return (ECommerce.Model.Controles.WebControl)ECommerce.DAO.Cache.CacheHelper.GetObjetoById(ident);
        }
        public static ECommerce.Model.Controles.WebControl[] GetWebControlsDelSistema()
        {
            return (ECommerce.Model.Controles.WebControl[])ECommerce.DAO.Cache.CacheHelper.GetObjetos(0, "WebControlsDelSistema");
        }
        public static ECommerce.Model.Controles.WebControl[] GetWebControlsByWebControlId(int IdWebControl)
        {
            return (ECommerce.Model.Controles.WebControl[])ECommerce.DAO.Cache.CacheHelper.GetObjetos(IdWebControl, "WebControlsByWebControl");
        }

        //Insert Methods
        public static void SetWebControl(ECommerce.Model.Controles.WebControl WebControl)
        {
            ECommerce.DAO.Cache.CacheHelper.SetObjeto(WebControl);
        }
        public static void SetWebControlsDelSistema(ECommerce.Model.Controles.WebControl[] WebControls)
        {
            ECommerce.DAO.Cache.CacheHelper.SetObjetos(WebControls, 0, "WebControlsDelSistema");
        }
        public static void SetWebControlsByWebControl(ECommerce.Model.Controles.WebControl[] WebControls, int IdWebControl)
        {
            ECommerce.DAO.Cache.CacheHelper.SetObjetos(WebControls, IdWebControl, "WebControlsByWebControl");
        }

        //Clear Methods
        public static void DelWebControl(ECommerce.Model.Controles.WebControl WebControl)
        {
            ECommerce.DAO.Cache.CacheHelper.DelObjeto(WebControl);
        }
        public static void DelWebControlsDelSistema()
        {
            ECommerce.DAO.Cache.CacheHelper.DelObjetos(0, "WebControlsDelSistema");
        }
        public static void DelWebControlsByWebControlId(int IdWebControl)
        {
            ECommerce.DAO.Cache.CacheHelper.DelObjetos(IdWebControl, "WebControlsByWebControl");
        }
    }
}
